// 资源视频模型详情js
var $scope = null;
$(function() {
	var appElement = document.querySelector('[ng-controller=main]');
	$scope = angular.element(appElement).scope();
	var videoId = locationHref("videoId");
	$scope.videoId = videoId;
	initialPage($scope);
	$scope.methods.imageList();

});
function initialPage($scope) {
	
}
var mainApp = angular.module("mainApp", []);
mainApp.controller('main', function($scope,$sce) {
	$scope.search = {};
	$scope.methods = {
		//动态列表
		imageList: function() {
			$.ajax({
				url: $.shysUrlPrefix + '/website/video/' + $scope.videoId,
				type: 'get',
				dataType: 'JSON',
				async: true, //同步方式发起请求
				success: function(data) {
					if (data.data != null ) {
						var src = $("<source src=\"" + data.data.videoUrl + "\" type=\"video/mp4\" id=\"Video_urlPic\">");
						$("#Video_urlPic_Main").append(src);
						// $("#Video_urlPic").attr("src", data.data.videoUrl);
						// $scope.videoUrl =$sce.trustAsResourceUrl(data.data.videoUrl) ;
						$scope.videoUrlA =data.data.videoUrl ;
						 $scope.author = data.data.author;
						 $scope.labelName = data.data.labelName;//标签
						 $scope.videoDesc = data.data.videoDesc;//描述
						 $scope.videoName = data.data.videoName;//描述
						  $scope.createTime = data.data.createTime;//描述
						$scope.$apply();
					} else {

					}

				},

			})
		},
		//影音跳转
		audio: function () {
		 window.location.href="resource.html?dynamicTypeId=2"
		},

	}
});
